<?php if ($this->session->userdata('logged_in')) { 
    redirect('admin'); 
} ?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <?php echo link_tag('resources/css/login.css', 'stylesheet', 'text/css'); ?>
        <title><?php echo $title; ?></title>
    </head>
    <body>
        <h1>Login Here</h1>
        <?php echo validation_errors(); ?>
            <?php echo form_open('login/validate', array('id' => 'login_form')); ?>
            <?php echo form_label('Username:', 'username'); ?><br/>
            <?php echo form_input($username); ?><br/>
            <?php echo form_label('Password:', 'password'); ?><br/>
            <?php echo form_input($password); ?><br/>
            <?php echo form_submit('submit', 'Login', 'id="btn_login"'); ?>
            <input type="button" value="Return Home" id="btn_cancel" onclick="window.location='<?php echo base_url() ?>home'" />
        <?php echo form_close(); ?>
    </body>
</html>
